/**
 * 
 */
package com.zxc.redis.RCountDownLatch;

import org.redisson.Redisson;
import org.redisson.api.RCountDownLatch;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;

/**
 * @author Administrator
 *
 */
public class RCountDownLatchDemo1 {

	/**
	 * @param args
	 * @throws InterruptedException 
	 */
	public static void main(String[] args) throws InterruptedException {
		Config config = new Config();
		config
			//.setCodec(new FstCodec())
			.useSingleServer() //单例模式
			.setAddress("192.168.1.122:6379")//连接地址
			.setDatabase(1) // 数据库索引位置
			.setPassword("shijie99test") // 密码
			.setClientName("channelbatch") // 客户端名称
			;
		final RedissonClient redisson = Redisson.create(config);
		
		RCountDownLatch latch = redisson.getCountDownLatch("anyCountDownLatch");
		latch.countDown();
		System.out.println("当前的count值："+latch.getCount());
		
		redisson.shutdown();

	}

}
